package com.ruoyi.paymentConfig.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.paymentConfig.mapper.PaymentConfigMapper;
import com.ruoyi.paymentConfig.domain.PaymentConfig;
import com.ruoyi.paymentConfig.service.IPaymentConfigService;

/**
 * 缴费配置Service业务层处理
 *
 * @author ch
 * @date 2022-03-11
 */
@Service
public class PaymentConfigServiceImpl implements IPaymentConfigService
{
    @Autowired
    private PaymentConfigMapper paymentConfigMapper;

    /**
     * 查询缴费配置
     *
     * @param id 缴费配置主键
     * @return 缴费配置
     */
    @Override
    public PaymentConfig selectPaymentConfigById(Long id)
    {
        return paymentConfigMapper.selectPaymentConfigById(id);
    }

    /**
     * 查询缴费配置列表
     *
     * @param paymentConfig 缴费配置
     * @return 缴费配置
     */
    @Override
    public List<PaymentConfig> selectPaymentConfigList(PaymentConfig paymentConfig)
    {
        return paymentConfigMapper.selectPaymentConfigList(paymentConfig);
    }

    /**
     * 新增缴费配置
     *
     * @param paymentConfig 缴费配置
     * @return 结果
     */
    @Override
    public int insertPaymentConfig(PaymentConfig paymentConfig)
    {
        paymentConfig.setCreateTime(DateUtils.getNowDate());
        return paymentConfigMapper.insertPaymentConfig(paymentConfig);
    }

    /**
     * 修改缴费配置
     *
     * @param paymentConfig 缴费配置
     * @return 结果
     */
    @Override
    public int updatePaymentConfig(PaymentConfig paymentConfig)
    {
        paymentConfig.setUpdateTime(DateUtils.getNowDate());
        return paymentConfigMapper.updatePaymentConfig(paymentConfig);
    }

    /**
     * 批量删除缴费配置
     *
     * @param ids 需要删除的缴费配置主键
     * @return 结果
     */
    @Override
    public int deletePaymentConfigByIds(Long[] ids)
    {
        return paymentConfigMapper.deletePaymentConfigByIds(ids);
    }


    /**
     * 批量逻辑删除缴费配置
     *
     * @param ids 需要删除的缴费配置主键
     * @return 结果
     */
    @Override
    public int logicDeletePaymentConfig(Long[] ids,String delType,Long delUser)
    {
        return paymentConfigMapper.logicDeletePaymentConfig(ids,delType,delUser);
    }

    /**
     * 删除缴费配置信息
     *
     * @param id 缴费配置主键
     * @return 结果
     */
    @Override
    public int deletePaymentConfigById(Long id)
    {
        return paymentConfigMapper.deletePaymentConfigById(id);
    }
}
